import request from "@/utils/request";

// 获取告警策略列表
export function getAbnormalStrategy(params) {
  return request({
    url: "/robot-abnormal-users/v1/list",
    method: "get",
    params: params,
  });
}
// 获取指定通知渠道的接收人列表
export function getAbnormalContact(params) {
  return request({
    url: "/abnormal-user/v1/list",
    method: "get",
    params: params,
  });
}
// 编辑任务
export function updateAbnormalStrategy(id, data) {
  return request({
    url: "/robot-abnormal-users/v1/update",
    method: "put",
    data: data,
  });
}
// 删除任务
export function deleteAbnormalStrategy(id) {
  return request({
    url: "/robot-abnormal-users/v1/delete/" + id,
    method: "delete",
  });
}
// 添加告警
export function createAbnormalStrategy(data) {
  return request({
    url: "/robot-abnormal-users/v1/create",
    method: "post",
    data: data,
  });
}
// 获取一条告警策略
export function getAbnormalStrategyOne(id) {
  return request({
    url: "/robot-abnormal-users/v1/getOne/" + id,
    method: "get",
  });
}
// 返回绑定码（普通用户）
export function getAbnormalCompanyWx() {
  return request({
    url: "/company/v1/getCompanyWx",
    method: "get",
  });
}
// 查询公司档案列表（管理员）
export function getAbnormalCompanyId() {
  return request({
    url: "/company/v1/getCompanyId",
    method: "get",
  });
}
// 根据公司id生成md5码
export function getAbnormalWxCode(id) {
  return request({
    url: "/company/v1/getCompanyWxCode/" + id,
    method: "get",
  });
}
// 获取联系人列表
export function getAbnormalUser(params) {
  return request({
    url: "/abnormal-user/v1/list",
    method: "get",
    params: params,
  });
}

// 删除联系人
export function deleteAbnormalUser(id) {
  return request({
    url: "/abnormal-user/v1/delete/" + id,
    method: "delete",
  });
}

// 创建联系人
export function createAbnormalUser(data) {
  return request({
    url: "/abnormal-user/v1/create",
    method: "post",
    data: data,
  });
}

// 查询一条联系人数据
export function getAbnormalUserOne(id) {
  return request({
    url: "/abnormal-user/v1/getById/" + id,
    method: "get",
  });
}

// 修改联系人
export function updateAbnormalUser(id, data) {
  return request({
    url: "/abnormal-user/v1/update",
    method: "put",
    data: data,
  });
}
